<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui-2.4.2/src/css/layui.css">
    <script type="text/javascript" src="/jquery/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/layui-2.4.2/src/layui.js"></script>
</head>
<body>
<div>
    <div class="layui-row">
        <div class="layui-form">
            <div class="layui-form-item">

                <label class="layui-form-label">账号id:</label>
                <div class="layui-input-inline">
                    <input type="text" id="user_accountid_input" name="user_accountid_input" required
                           lay-verify="required"
                           placeholder="请输入账号id"
                           autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">手机号:</label>
                <div class="layui-input-inline">
                    <input type="text" id="user_phone_input" name="user_phone_input" lay-verify="required|phone"
                           placeholder="请输入手机号"
                           autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">排序:</label>
                <div class="layui-input-inline">
                    <select name="type_select" class="type_select"
                            lay-filter="type_select">
                        <option value="">用户id</option>
                        <option value="0">蜂蜜</option>
                        <option value="1">蜜糖</option>
                        <option value="2">个人勤劳度</option>
                        <option value="3">团队勤劳度</option>
                        <option value="4">总勤劳度</option>
                    </select>
                </div>

                <button class="layui-btn" id="search">搜索</button>
                <button class="layui-btn" id="export">导出</button>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <table id="user_list_view" lay-filter="user_filter">

        </table>
    </div>
</div>
</body>

<script>
    layui.use(['element', 'table', 'upload', 'laytpl', 'form'], function () {
        var table = layui.table;
        table.render({
            elem: '#user_list_view',
            url: '/userWallet/queryList',
            page: true,
            limit: 10,
            limits: [10, 20, 50, 100],
            cols: [
                [
                    {field: 'accountId', title: '账户id', width: 150},
                    {field: 'nickName', title: '用户昵称', width: 150},
                    {field: 'mobile', title: '手机号', width: 200},
                    {field: 'diligenceDegree', title: '总勤劳度', width: 150},
                    {field: 'honey', title: '蜂蜜', width: 150},
                    {field: 'honeySugar', title: '蜜糖', width: 150},
                    {field: 'usdt', title: 'usdt', width: 150},
                    {field: 'personDiligenceDegree', title: '个人勤劳度', width: 150},
                    {field: 'teamDiligenceDegree', title: '团队勤劳度', width: 150}
                ]
            ],
            response: {
                status: 'errorCode',
                countName: 'total',
                dataName: 'data'
            }
        });
        $("#search").on('click', function () {
            table.reload('user_list_view', {
                url: '/userWallet/queryList',
                where: {
                    accountId: $('#user_accountid_input').val(),
                    mobile: $('#user_phone_input').val(),
                    type: $('.type_select').val()
                }
            });
        });
        $("#export").on('click', function () {
            var accountId = $('#user_accountid_input').val();
            var mobile = $('#user_phone_input').val();
            var type = $('.type_select').val();
            window.location="/userWallet/export?&accountId="+accountId+"&mobile="+mobile+"&type="+type;
        });

    });
</script>
</html>